//
//  Student.m
//  Mobile4S
//
//  Created by Nong Nghia on 8/3/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "Student.h"

@implementation Student

@synthesize studentID;
@synthesize studentName;
@synthesize studentFullName;
@synthesize studentPhone;
@synthesize isDeletedStudent;
@synthesize version;
@synthesize studentCode;
@synthesize studentDomain;

- (void)parseFromItem:(Items*)item{
    for (NSString *key in [item allKeys]) {
        [self setValue:[item valueForKey:key] forKey:key];
    }
    
}

- (Items*)itemObject{
    Items * item = [[Items alloc] initWithKeys:[NSArray arrayWithObjects:
                                                @"studentID", 
                                                @"studentName", 
                                                @"studentFullName", 
                                                @"studentPhone", 
                                                @"isDeletedStudent", 
                                                @"version", 
                                                @"studentCode",
                                                @"studentDomain",
                                                nil]];
    
    for (NSString *key in [item allKeys]) {
        [item setValue:[self valueForKey:key] forKey:key];
    }
    
    return [item autorelease];
}

@end
